﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using WeiXinPF.Model;


namespace WeiXinPF.Modules.Core.Admin.Domain.Models
{
    public class SmartContext : DbContext
    {
        public SmartContext()
           : base("name=ConnectionString")
        {
            //Database.SetInitializer<SmartContext>(null);
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Types()
                .Configure(entity => entity.ToTable(entity.ClrType.Name));
            modelBuilder.Entity<advertisement>()
                 .HasKey(t => t.id);
        }

        public virtual DbSet<advertisement> advertisement { get; set; }
    }
}
